//
//  MoreDoctorCell.m
//  WE
//
//  Created by iMacOne on 15/11/21.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "MoreDoctorCell.h"
#import "Size.h"
#import "CustomView.h"
#import "ToolUtil.h"
@interface MoreDoctorCell ()
@property (nonatomic, strong)UIImageView *imageV;
@property (nonatomic, strong)UIImageView *teamImageV;
@property (nonatomic, strong)UILabel *contentLabel;
@property (nonatomic, strong)UILabel *nameLabel;
@property (nonatomic, strong)UILabel *levelLabel;
@property (nonatomic, strong)UILabel *numberLabel;
@property (nonatomic, strong)UILabel *specialityLabel;

@end

@implementation MoreDoctorCell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(20*Width, 20*Height, 60*Width, 60*Width)];
        _imageV.backgroundColor = DEBUG_CLOLR;
        _imageV.layer.masksToBounds = YES;
        self.imageV.layer.cornerRadius = 30*Width;
        [self addSubview:self.imageV];
        
        _teamImageV = [[UIImageView alloc] initWithFrame:CGRectMake(25*Width, CGRectGetMaxY(_imageV.frame) + 3, 50*Width, 20*Height)];
        _teamImageV.backgroundColor = DEBUG_CLOLR;
        _teamImageV.layer.masksToBounds = YES;
        _teamImageV.layer.cornerRadius = 3;
        [self addSubview:_teamImageV];

        self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(100*Width, 10*Height, 50*Width, 20*Height)];
        self.nameLabel.font = FONT(14);
        _nameLabel.text = @"范建高";
        self.nameLabel.backgroundColor = [UIColor whiteColor];
        self.nameLabel.textColor = [UIColor blackColor];
        [self addSubview:self.nameLabel];
        
        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(150, 10*Height, 60*Width, 20*Height)];
        label.text = @"主治医师";
        label.font = FONT(12);
        [self addSubview:label];
        
        self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(_nameLabel.frame.origin.x, CGRectGetMaxY(_nameLabel.frame) + 5, (WindowWidth - _nameLabel.frame.origin.x)-20 , margin_20)];
        _contentLabel.text = @"华中科技大学同济医学学院协和医院 消化科的一位很棒的医生"
        ;
        _contentLabel.font = FONT(13);
        [self addSubview:_contentLabel];
        
        UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(200*Width, 20*Height, 20*Width, 20*Height)];
        label1.text = @"号";
        label1.textAlignment = NSTextAlignmentCenter;
        label1.font = FONT(10);
        label1.backgroundColor = [UIColor greenColor];
        label1.textColor = [UIColor whiteColor];
//        [self addSubview:label1];
        
        
        self.levelLabel = [[UILabel alloc] initWithFrame:CGRectMake(100*Width, 60*Height, 40, 20*Height)];
//        _levelLabel.backgroundColor = DEBUG_CLOLR;
        NSString * text = @"★10.0";
        
        NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:text];
        NSInteger i = text.length;
        [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12] range:NSMakeRange(0, i-2)];
        [str addAttribute:NSForegroundColorAttributeName value:[UIColor orangeColor] range:NSMakeRange(0, i)];
        
        [str addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:10] range:NSMakeRange(i-1, 1)];
        
        _levelLabel.font = FONT(13);
        _levelLabel.attributedText = str;
        [self addSubview:self.levelLabel];
        
        self.numberLabel = [[UILabel alloc] initWithFrame:CGRectMake(160*Width, 60*Height, 80, 20*Height)];
//        _numberLabel.backgroundColor = DEBUG_CLOLR;
        _numberLabel.text = @"接诊量 645";
        self.numberLabel.textColor = [UIColor blackColor];
        self.numberLabel.font = FONT(12);
        [self addSubview:self.numberLabel];
        
        self.specialityLabel = [[UILabel alloc] initWithFrame:CGRectMake(100*Height, _teamImageV.frame.origin.y, WindowWidth - 110*Height, 20*Height)];
        self.specialityLabel.font = FONT(12);
        _specialityLabel.textColor = [UIColor grayColor];
        _specialityLabel.text = @"擅长: 消化系统疾病特别是慢性肝病的诊治, 在脂肪肝等问题有专业研究";
//        _specialityLabel.backgroundColor = DEBUG_CLOLR;
        [self addSubview:self.specialityLabel];
        NSArray * arr = @[@"200元",@"未开通",@"未开通"];
        NSArray * arr1 = @[@"iconfont-tuwenxiaoxi",@"iconfont-weishezhi",@"iconfont-weishezhi"];
        for (int i = 0; i < 3; i++) {
            
            CustomView * customV = [[CustomView alloc] initWithFrame:CGRectMake(_levelLabel.frame.origin.x + i*(WindowWidth - _levelLabel.frame.origin.x)/3 - 1, CGRectGetMaxY(_specialityLabel.frame) + 10*Height,(WindowWidth - _levelLabel.frame.origin.x)/3 - 1, 40*Height)];
            [customV creatImageVAndLblView:arr1[i] lblText:arr[i]];
//            [ToolUtil createVerticalLine:0 superView:customV lift:(i + 1)*((WindowWidth - _levelLabel.frame.origin.x)/3 - 1) height:40];
            [self addSubview:customV];
            
        }

        
    }
    return self;
}
@end
